﻿using MVVMPattern.Base;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MVVMPattern.Models
{
    public class ResultModel
    {
        public string Msg { get; set; }

        public Command DeleteCommand { get; set; }

        ObservableCollection<ResultModel> ResultModels = new ObservableCollection<ResultModel>();
        public ResultModel(ObservableCollection<ResultModel> resultModels)
        {
            ResultModels = resultModels;
            DeleteCommand = new Command(Delete);
        }

        private void Delete(object? parameter)
        {
            // Do something to delete the result
            ResultModels.Remove(this);
        }
    }
}
